The present invention is directed to an apparatus for digitally encoding/decoding data including pictorial images and sounds for use in, for example, High Definition Television (HDTV), High Definition-Video Tape Recorder (HD-VCR), digital VCR, digital camcorder, multimedia, videophone, and video conference type applications. More particularly, the present invention relates to a motion estimating device for variable length encoded data.
Korean Patent Application No. 92-7757, upon which a claim to priority is made, is incorporated herein by reference.
Recently, interest and attention has been directed to methods for digitally encoding images and sound data for storing and/or transmitting and methods for subsequently decoding the stored or transmitted encoded data.
In devices such as a HDTV, HD-VCR, digital VCR, digital camcorder, multimedia, videophone, video conference and the like, there is presently an ongoing international effort to develop a standardized coding method, which is adequate to suit the respective fields for each of the above devices.
Referring to FIG. 1, there is shown a block diagram of a conventional motion compensated Differential Pulse Code Modulation (DPCM) coded transmitting device, which implements one method of reducing the amount of data and restricting the amount of redundancy in a video signal. Other methods to achieve the same results include transform coding, DPCM, vector quantization, and variable length coding.
According to FIG. 1, an N.times.N transform unit 1 divides a picture into a gathering of small blocks of N.times.N (N=8, for example) in order to perform data compression within the picture, and transforms each respective block so as to convert a video signal VS from the time domain to the frequency domain. As a result of the transformation, the signal energy is gathered mainly toward the low frequency areas. The transform unit 1 may implement any of the following transformation functions, including a Discrete Cosine Transform (DCT), a Walsh-Hadamard Transform (WHT), a Discrete Fourier Transform (DFT), a discrete Sine Transform (DST), etc. The DCT is the most widely used.
A quantizer 3 quantizes transform coefficients, which are output by the N.times.N transform unit 1 in accordance with a quantization step size q determined by the state of a buffer 6. In other words, the transform coefficients are changed or quantized to representative values, which the human naked eye cannot distinguish from the values prior to the quantization process.
At this time, the quantization step size q, which continues to change in accordance with the state of the buffer, controls the quantization to thereby adjust the bit rate and to thereafter transmit the same to a receiving terminal.
A variable length encoder 5, which is coupled to an output of the quantizer 3, makes the most of statistical characteristics of the representative quantized values from the quantizer 3 and performs variable length coding to thereby compress the data, accordingly.
A buffer 6 receives the compressed data from the variable length encoder 5. The buffer 6 adjusts the rate at which data is received from the variable length encoder 5 to thereby output the same CVS. At the same time, the quantization step size q, which changes according to the degree of fullness of the buffer, is fedback to adjust the data output of the quantizer 3, so as to prevent data overflows and underflows.
Meanwhile, the data amount outputted from the quantizer 3 can be further compressed by a motion compensation method. In other words, the data amount can be compressed by utilization of the similarity between the pictures. In particular, because there is no change between pictures in the case of a still picture, for example, the data amount can further be compressed.
A motion vector can be obtained by estimating the amount of motion of a picture (which is not necessarily a still picture). The motion between successive pictures is compensated through the use of a motion vector. Since the difference between two pictures or the motion thereof is very small, data compression can be made possible.
A motion compensated DPCM method has been adopted between pictures in FIG. 1 utilizing such characteristics. Specifically, the motion compensation is performed by a DPCM loop comprised of a frame memory 7, a motion estimation unit 8, and a motion compensation unit 9.
An inverse quantizer 4 inversely quantizes the quantized data prior to performing the motion compensation process, and an N.times.N inverse transform unit 2 transforms a signal from the frequency domain to a video signal in the time domain.
A motion estimating unit 8 receives video data of a prior picture stored in the frame memory 7 and an inputted video signal to thereby estimate the amount of motion between the two pictures and to generate a motion vector MV. The motion is based on the difference of the inputted video signal relative to the prior picture. The motion vector MV is then transmitted to a decoding unit and outputted to the motion compensation unit 9.
The motion compensating unit 9 receives video data from a corresponding position of the frame memory 7 according to the motion vector MV obtained from the motion estimating unit 8 to thereby compensate for the motion. The compensated motion is added to an output of the N.times.N inverse transform unit 2 to thereafter be inputted to the frame memory 7.
The picture compensated from the motion compensating unit 9 is further inputted to a first mixer A1, which produces an error signal by subtracting the output of the motion compensating unit 9 from a current picture signal VS.
At this stage, a first and a second switch SW1 and SW2 cut off an output signal of the motion compensation unit 9 either by block or by frame in order to prevent errors from increasing on a picture where quantized noises generating from the DPCM loop are accumulated and restored, to thereby effect intraframe coding.
Meanwhile, in order to obtain the motion vector MV from the aforementioned motion estimating unit 8, a block matching method is employed.
In other words, first, the present picture is partitioned into a motion block of N.sub.1 .times.N.sub.2, and a determination is made as to its position within the reference picture having a seek domain of M.sub.1 .times.M.sub.2. The motion vector MV is then computed at the point in which the Mean Absolute Error MAC or Mean Square Error MSE is minimized.
FIG. 2 illustrates a block diagram of a conventional motion estimating unit for determining the motion vector MV.
In FIG. 2, a first N.sub.1 .times.N.sub.2 block forming unit 10 partitions the incoming picture into a block of N.sub.1 .times.N.sub.2 size (N being a pixel unit).
An M.sub.1 .times.M.sub.2 block forming unit 20 establishes a seek domain on a reference picture (i.e., a picture prior to the current picture or a prior picture reproduced from the DPCM loop), which is stored in the frame memory 7.
In other words, in order to determine the position within the reference picture the N.sub.1 .times.N.sub.2 block has moved, a seek block of M.sub.1 .times.M.sub.2, which is larger than the block of N.sub.1 .times.N.sub.2 that is about to be encoded is established.
A second N.sub.1 .times.N.sub.2 block forming unit 30, which is coupled to an output of the block forming unit 20, generates data of a N.sub.1 .times.N.sub.2 block size according to a horizontal/vertical displacement (K,1) value.
An adder A10 obtains a data error outputted from the first and second N.sub.1 .times.N.sub.2 block forming units 10 and 30, and a mean error calculating unit 40 calculates an absolute mean (or a square mean) based on the errors outputted from the adder A10.
A minimum value seek unit 50 selectively outputs as the motion vector MV the horizontal/vertical displacement (K,l) value when it possesses the smallest error value out of the error values calculated from the mean error calculating unit 40.
In other words, the error value is calculated while the horizontal/vertical displacement (K,l) value is changed, and a block is recognized as a moved block when the calculated error value is the smallest so that the horizontal/vertical displacement (k,l) value is recognized as the motion vector MV, which is then outputted.
At this point, in order to obtain the mean error from the mean error calculating unit 40, methods such as the Mean Absolute Error or Mean Square Error among pixels of respective blocks and the like are typically utilized.
However, although the conventional technique for implementing the above-described motion vector estimation process is effective when a motion vector is transmitted as a code of a fixed length, it is difficult to implement the same process for a variable length encoded motion vector because it is difficult to determine when a coded final data amount is minimized.
In other words, there is a problem in that a whole vector amount tends to be increased if the code length of the motion vector is lengthened and when the motion vector is variable length encoded, even though the amount of data of the image signal is minimized.